
class MyThread extends Thread {
    @Override
    public void run() {
       while (true) {
        System.out.println("线程");
       }
    }
}

public class Demo1 {
    public static void main(String[] args) {
        Thread thread = new MyThread();
        thread.start();
        while (true) {
            System.out.println("主函数");
        }
    }
}
